<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }

    .outer{
      width: 1000px;
      height: 200px;
      border: 1px solid #000;
    }

    .inner{
      width: 100px;
      height: 100px;
    }

    .inner1{
      background-color: antiquewhite;
      transition: all 1s linear;
    }

    .outer:hover .inner1{
      transform: translate(900px);
    }

    .inner2{
      background-color: aqua;
      animation: zjm-move 1s linear forwards;
    }

    @keyframes zjm-move {
      0% {
        transform: translateX(0);
      }

      /* 动画可以控制中间的状态 */
      50%{
        background-color: rebeccapurple;
      }

      100% {
        transform: translateX(900px);
      }
    }
  </style>
</head>

<body>
<div class="outer">
  <div class="inner inner1">过渡</div>
  <div class="inner inner2">动画</div>
</div>
</body>

</html>